#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int lowbit(int n)
    {
        int x = n & -n;
        return x;
    }
    int NumberOf1(int n) {
        int cnt = 0;
        while (n)
        {
            n -= lowbit(n);
            cnt++;
        }
        return cnt;
    }
};